<template>
  <div class="app-container">

    <el-empty v-if="show && boardingStatus == '0'"
              description="请先完成登机"></el-empty>

<!--    <el-empty v-if="cxXlCzAjInfo != null && cxXlCzAjInfo.zjtyJlJc == '0'"-->
<!--              description="请将行李放置在对应值机传送带"></el-empty>-->

    <div v-if="show && boardingStatus == '1' && cxXlCzAjInfo != null">
      <el-card class="box-card">
        <div slot="header" class="clearfix">
          <div>
            <span class="el-tag el-tag--warning">称重-安检信息</span>
            <span style="color: red;margin-left: 30px;font-size: 14px">请确定已将行李放置在对应值机传送带</span>
            <el-button v-if="cxXlCzAjInfo.startCzAj == '0'" style="float: right;
           padding: 3px 0" type="text" @click="handleCzAj"
            >启动称重-安检</el-button>
            <span v-else style="float: right; padding: 3px 0; font-size: 14px; color: #8B0000">已完成称重-安检</span>
          </div>
        </div>
        <el-descriptions style="text-align: center" title="" direction="vertical" :column="3" border>
          <el-descriptions-item label="是否完成称重">{{this.cxXlCzAjInfo.zjtyXlCz}}</el-descriptions-item>
          <el-descriptions-item label="重量是否合格">{{this.cxXlCzAjInfo.zjtyXlCzZt}}</el-descriptions-item>
          <el-descriptions-item label="行李重量(KG)">{{this.cxXlCzAjInfo.zjtyXlZl}}</el-descriptions-item>
          <el-descriptions-item label="是否完成安检">{{this.cxXlCzAjInfo.zjtyXlAj}}</el-descriptions-item>
          <el-descriptions-item label="安检是否合格">{{this.cxXlCzAjInfo.zjtyXlAjZt}}</el-descriptions-item>
        </el-descriptions>
      </el-card>
    </div>
  </div>
</template>

<script>

import {startCzAj} from "@/api/ckxl/xl";

export default {
  name: "SecurityCheck",
  props: ['cxXlCzAjInfo', 'show', 'boardingStatus', 'queryParams'],
  data() {
    return {
    };
  },
  created() {
  },
  computed:{
  },
  methods: {

    /** 启动称重安检，启动值机 */
    handleCzAj() {
      var _this = this;
      this.$modal.confirm('是否确认启动称重-安检？').then(function() {
        const data = {'passengerName': _this.queryParams.passengerName,
          'passengerIdCard': _this.queryParams.passengerIdCard, 'djLx': _this.queryParams.djLx}
        return startCzAj(data);
      }).then(() => {
        this.$emit('start-cz-aj-success', '启动称重-安检成功')
      }).catch(() => {});
    },

  }
};
</script>

<style lang="scss" scoped>
.text {
  font-size: 14px;
}

.item {
  margin-bottom: 18px;
}

.clearfix:before,
.clearfix:after {
  display: table;
  content: "";
}
.clearfix:after {
  clear: both
}

.box-card {
  width: 100%;
}
</style>
